package com.vcg.filter.service;

import com.vcg.filter.service.impl.*;
import org.springframework.util.Assert;

/**
 * 业务处理的工厂,针对不同的的业务生产不同的处理器
 *
 * @author felayman
 * @since 16/1/13
 */
public class ServiceFactory {


    private ServiceFactory() {

    }

    public static Service getServiceImpl(String type) {
        Assert.notNull(type, "type must not be null");
        if (type.equals("user")) {
            return new UserServiceImpl();
        } else if (type.equals("photo")) {
            return new PhotoServiceImpl();
        } else if (type.equals("gallery")) {
            return new GalleryServiceImpl();
        } else if (type.equals("like")) {
            return new LikeServiceImpl();
        } else if (type.equals("follow")) {
            return new FollowServiceImpl();
        }
        return null;
    }
}
